As computer graphics have become more common, techniques for rendering images of objects smoothly and quickly have become more important. For example, computer aided drawing programs, computer animations and computer games may all require spheres to be drawn accurately and quickly. Conventionally, spheres may be rendered using ray tracing techniques and/or by tessellating a sphere into a number of other polygons, triangles for example. Such techniques may not produce the sphere quickly enough, or may fail to provide for smooth, accurate renderings of the sphere. For example, when tessellating, the image quality of the sphere may suffer unless a very large number of triangles (>1000) is utilized. But utilizing such a large number of triangles may slow down the rendering time of the sphere and of other graphics images. Similarly, although ray tracing may provide a smooth result, the rendering may be slower than desired because computing the intersection points, color components and texture components of the many rays of light projected into a scene, as is done in ray tracing methods, may be computationally slow. The slow computations involved in ray tracing may be exacerbated if the conventional ray tracing system does not store or pre-cache computations utilized in such intersection point, color and texture component processing.
Accurately rendering an image of a three dimensional, lit, textured sphere may depend on several attributes associated with the sphere. First, the rendering may account for the ambient light associated with the sphere. The ambient light is the light that is all around the sphere and which thus has an equal effect on the entire rendering. Next, diffuse light may be addressed. The intensity of the diffuse light on any point on the sphere may depend on the location of the light source and the angle of incidence of the light from the source on the point on the sphere. Next, the specular light associated with the sphere may be addressed. The intensity of the specular light on any point on the sphere depends on the location of the light source, and depends on the location of the viewer of the sphere. There may be multiple ambient, diffuse and specular light sources affecting a sphere and each light source may have a different location, intensity and color. Thus, conventionally rendering a lit sphere may require multiple equations dealing with numerous lighting attributes. Conventionally, such equations are computed during rendering and employ floating-point calculations.
Rendering a sphere may be further complicated if the sphere is “textured”, that is, if the rendering includes wrapping a two-dimensional surface around the sphere to provide simulated relief or texture to the sphere. Conventionally, mapping a two-dimensional surface onto a curved three-dimensional surface has been complicated by run time translations of coordinate systems using floating-point arithmetic.
Thus, there remains a need for a method to smoothly render lit, textured spheres using as few calculations as possible to facilitate higher performance rendering.